
var saved_onselectstart_func=false;
var saved_onselectstart_flag=false;
function noSelection(){return false;}
function switchSelection(){
  try{
    if(saved_onselectstart_flag){
      document.body.onselectstart=saved_onselectstart;
      saved_onselectstart=false;
      saved_onselectstart_flag=false;
      if (typeof document.body.style.MozUserSelect!="undefined"){
        document.body.style.MozUserSelect=true;
      }
    }else{
      saved_onselectstart=document.body.onselectstart;
      document.body.onselectstart=noSelection;
      saved_onselectstart_flag=true;
      if (typeof document.body.style.MozUserSelect!="undefined"){
        document.body.style.MozUserSelect="none";
      }
    }
  }catch(e){
    alert("switchSelection:"+e.message);
  }
}

